<script>
	// #ifdef APP-PLUS
	import {
		updateApp
	} from '@/utils/updateApp.js'
	// #endif
	import {
        initSocket
	} from '@/net/mySocket.js'
	export default {
		onLaunch: function() {
			//创建 socket 接收消息
            initSocket()

			// #ifdef APP-PLUS
			// 手机端检测更新APP
			updateApp()

			//调起常驻通知服务
			try {
				plus.android.importClass("android.content.Intent");
				plus.android.importClass("com.plugin.app_active.MyService");

				let mainActivity = plus.android.runtimeMainActivity();
                let Intent = plus.android.importClass("android.content.Intent");
                let MyService = plus.android.importClass("com.plugin.app_active.MyService");

                let intent = new Intent(mainActivity, MyService.class);
				mainActivity.startForegroundService(intent);
			} catch (e) {
				console.log("调起服务 通知（查看是否运行本地基座模式，是否包含插件） err = ", e)
			}
			// #endif

			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		methods: {}
	}
</script>

<style lang="scss">
	@import "uview-ui/index.scss";
</style>